package com.zzw.design.command;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zzw
 * @see
 * @since 2018/3/21
 */
public class FBSettingWindow {
    private String title; //窗口标题
    //定义一个ArrayList来存储所有功能键
    private List<FunctionSettingButton> buttons = new ArrayList<FunctionSettingButton>();

    public FBSettingWindow(String title) {
        this.title = title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTitle() {
        return this.title;
    }

    public void addFunctionButton(FunctionSettingButton fb) {
        buttons.add(fb);
    }

    public void removeFunctionButton(FunctionSettingButton fb) {
        buttons.remove(fb);
    }

    //显示窗口及功能键
    public void display() {
        System.out.println("显示窗口：" + this.title);
        System.out.println("显示功能键：");
        for (FunctionSettingButton button : buttons) {
            System.out.println(button.getName());
        }
        System.out.println("------------------------------");
    }
}
